package com.atguigu.vod.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author: LDeng
 * @Date: 2021-12-31 10:41 AM
 */
@Component
public class ConstantPropertiesUtils implements InitializingBean {

    //读取配置文件内容

    @Value("${aliyun.vod.file.keyid}")
    private String keyId;

    @Value("${aliyun.vod.file.keysecret}")
    private String keySecret;

    //该方法在常量赋值后执行
    //定义公开静态常量

    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;



    @Override
    public void afterPropertiesSet() throws Exception {

        ACCESS_KEY_ID=keyId;

        ACCESS_KEY_SECRET=keySecret;

    }
}
